﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SystemCenterSoa.ApiProject.Area.SystemManager;
using SystemCenterSoa.DtoModel.Common;
using SystemCenterSoa.PoModel.SystemSettings.QualificationAdministration;
using SystemCenterSoa.Service.SystemSettings.QualificationAdministration;

namespace SystemCenterSoa.ApiProject.Area.SystemSettings.QualificationAdministration
{
    [AllowAnonymous]
    public class ArcTitltSettingController : SystemManagerBaseController
    {
        private ArcTitltSettingService _arcTitltSettingService;
        public ArcTitltSettingController(ArcTitltSettingService arcTitltSettingService)
        {
            _arcTitltSettingService = arcTitltSettingService;
        }
        [HttpPost]
        public ResultModel<bool> ArcTitltSettingAdd(ArcTitltSettingPo info)
        {
            try
            {
                var data = _arcTitltSettingService.ArcTitltSettingAdd(info);
                return MyOk(data);
            }
            catch (Exception ex)
            {
                return MyError<bool>(ex);
            }
        }
        [HttpPost]
        public ResultModel<bool> ArcTitltSettingDelete(string ids)
        {
            try
            {
                var data = _arcTitltSettingService.ArcTitltSettingDelete(ids);
                return MyOk(data);
            }
            catch (Exception ex)
            {
                return MyError<bool>(ex);
            }
        }
        [HttpGet]
        public ResultModel<ArcTitltSettingPo> ArcTitltSettingEdit(int id)
        {
            try
            {
                var data = _arcTitltSettingService.ArcTitltSettingEdit(id);
                return MyOk(data);
            }
            catch (Exception ex)
            {
                return MyError<ArcTitltSettingPo>(ex);
            }
        }
        [HttpPost]
        public ResultModel<bool> ArcTitltSettingUpdate(ArcTitltSettingPo info)
        {
            try
            {
                var data = _arcTitltSettingService.ArcTitltSettingUpdate(info);
                return MyOk(data);
            }
            catch (Exception ex)
            {
                return MyError<bool>(ex);
            }
        }
        [HttpPost]
        public ResultModel<PagerResult<ArcTitltSettingPo>> SearchPage(SearchModel sm)
        {
            try
            {
                var data = _arcTitltSettingService.SearchPage(sm);
                return MyOk(data);
            }
            catch (Exception ex)
            {
                return MyError<PagerResult<ArcTitltSettingPo>>(ex);
            }


        }
    }
}
